package study.encode.aes;

public class AesTest {
    public static void main(String[] args) throws Exception {
        String data = "hello";
//        String encryptedStr = "njRdozZwl8WGmdDBzvrcVA==";
        String sessionKey = "5d41402abc4b2a76b9719d911017c592";
        String iv = "0000000000000001";
        String encryptedStr = AesUtil.encrypt(data, sessionKey, iv);
        System.out.println(data);
        testEnc(data);
        testDec(encryptedStr);
    }

    public static void testEnc(String data) throws Exception {
        String sessionKey = "5d41402abc4b2a76b9719d911017c592";
        String iv = "0000000000000001";
        System.out.println(AesUtil.encrypt(data, sessionKey, iv));
    }

    public static void testDec(String encrypted) throws Exception {
        String sessionKey = "5d41402abc4b2a76b9719d911017c592";
        String iv = "0000000000000001";
        System.out.println(AesUtil.decrypt(encrypted, sessionKey, iv));
    }
}
